﻿using SolaceSystems.Solclient.Messaging;

using Unity.Credentials;
using Unity.Environment;

namespace Unity.Solace
{
    public class UnitySolaceCredentials : IUnityCredentials
    {
        public IContext GetContext()
        {
            return ContextFactory.Instance.CreateContext(new ContextProperties(), null);
        }

        public string GetTopic()
        {
            return UnityEnvironment.GetStringParameter(UnityParameter.SolaceTopic);
        }

        public SessionProperties GetSessionProperties()
        {
            return new SessionProperties()
            {
                Host = UnityEnvironment.GetStringParameter(""),
                VPNName = UnityEnvironment.GetStringParameter(""),
                AuthenticationScheme = AuthenticationSchemes.CLIENT_CERTIFICATE,
                SSLTrustStoreDir = UnityEnvironment.GetStringParameter(""),
                SSLClientCertificateFile = UnityEnvironment.GetStringParameter(""),
                SSLClientPrivateKeyFile = UnityEnvironment.GetStringParameter("")
            };
        }
        
    }
}